laravel eloquent to array key value

37

Icon::all()->keyBy('name')
$roles = Role::all()->keyBy('name');
$roles = collect(DB::table('roles')->get())->keyBy('name');

Comments

Submit
0 Comments